import { getToken,  } from '@/utils/public';
// setToken, removeToken
const StoreJS = require('store/dist/store.legacy');
export default {
  state: {
    token: getToken(),
    user:'',
  },
  mutations: {
    SET_TOKEN: (state, token) => {
      state.token = token;
      StoreJS.set('token',token)
    },
    SET_USER_INFO:(state,user)=>{
      state.user = user;
      StoreJS.set('user',user)
    },
    REMOVE_TOKEN:(state)=>{
      state.token = '';
      StoreJS.remove('token')
    }
  },
  actions:{

  }
};
